#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright @ 2014 OPS, Qunar Inc. (qunar.com)
#
# Author: tingfang.bao <tingfang.bao@qunar.com>
# DateTime: 15-3-11 下午2:24
import os
from flask import Flask, render_template, url_for, send_from_directory

app = Flask(__name__)


@app.route('/', methods=['GET'])
def index():
    return render_template("index.html")


# 这个与app.add_url_rule留一个就好了
@app.route('/favicon.ico')
def favicon():
    return send_from_directory(os.path.join(app.root_path, 'static'), 'favicon.icon',
                               mimetype='image/vnd.microsoft.icon')

# app.add_url_rule('/favicon.ico', redirect_to=url_for('static', filename='favicon.ico'))

if __name__ == '__main__':
    app.run(debug=True)